require("../../../utils/api.js");

var t = require("../../../utils/disapi.js"), o = getApp();

Page({
    data: {
        name: "",
        photo: "",
        total_money: 0,
        total_num: 0,
        total_turn: 0,
        comment: "",
        openid: ""
    },
    onLoad: function(a) {
        var e = this;
        this.setData({
            openid: o.globalData.openid
        }), wx.setNavigationBarColor({
            frontColor: wx.getStorageSync("basic").topcolor,
            backgroundColor: wx.getStorageSync("basic").topbg
        }), this.setData({
            openid: o.globalData.openid
        }), t.get_dis_commoned_info({
            openid: this.data.openid
        }).then(function(t) {
            if (0 == t.errno) {
                var o = t.data;
                if (0 == o.code) {
                    var a = o.data;
                    e.setData({
                        total_num: a.total_num,
                        total_money: a.total_money,
                        total_turn: a.total_turn,
                        comment: a.comment
                    });
                }
            }
        }), t.get_dis_user_info({
            openid: this.data.openid,
            scene: "1"
        }).then(function(t) {
            if (console.log(t), 0 == t.errno) {
                var o = t.data;
                0 == o.code && e.setData({
                    name: o.data.m_nickname,
                    photo: o.data.m_photo
                });
            }
        }), setTimeout(function() {
            e.setData({
                rotate: !1
            });
        }, 1e3);
    },
    rotate: function() {
        var t = this;
        t.setData({
            rotate: !0
        }), t.onLoad();
    }
});